
import {request} from "@/http";
import type {AvailableTeacherList, CancelAppointment,} from "@/http/reservation/module/reservation";
import type {LocationQueryValue} from "vue-router";


// 获取时间与日期
const getTime = function () {
    return request({method: 'get', url: '/schedule/dateTimeSpans?dateOffset=1', })
}

// 查询可预约的咨询师
const availableTeacher=function (data:any){
    return request({method:'get',url:'/system/teacher/availableTeachers',data:data,})
}

// 提交预约
const submitAppointment=function (data:any){
    return request({method:'post',url:'/appointment/commit',data:data})
}

// 预约详情
const appointmentDetail=function (id: string | null | LocationQueryValue[]) {
    return request({method: 'get', url: `/appointment/${id}`})
}

// 取消预约
const cancelAppointment=function (data:CancelAppointment){
    return request({method:'post',url:'/appointment/cancel',data:data})
}
export {getTime,availableTeacher,submitAppointment,appointmentDetail,cancelAppointment}